Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to retrieve file path for IVersionable from IChangeSet with IBaselineSet, Workspace given?

Given:
ISnapshotHandle snapshot1, snapshot2

temp Workspace created from that: IWorkspaceConnection tempWSConnection = SCMPlatform                    .getWorkspaceManager(teamRepository).createWorkspace(currentUser,name, comment, snapshot1, null);

List <IChangeSetHandle> changeSetList retrieved from:
IWorkspaceManager workspaceManager = SCMPlatform.getWorkspaceManager(teamRepository);
IChangeHistorySyncReport changeSync = workspaceManager.compareBaselineSets(snapshot1, snapshot2, null, null);
changeSetList = changeSync.outgoingChangeSets();

Looking for:
the easiest way to resolve the file name of the IVersionables in each ChangeSet of ChangeSetList in the context of the Workspace
Currently I iterate over the IVersionableHandles and do:
IFileItem file = (IFileItem) workspace.configuration(component).fetchCompleteItem(versionableHandle, monitor);
String fileName = file.getName();

Notice that for this I need the component for the ChangeSet in that particular workspace. Can I get this information in the case above where I retrieve Change Sets as a diff between two snapshots (compareBaselineSets) ?

Or is there a way to resolve the file name directly just by knowing workspace, change set, snapshot?

1 vote


Accepted answer

Permanent link
You'll still need the component. Since you have the change sets, you can retrieve the component from it.
Arne Bister selected this answer as the correct answer

2 votes

Comments

groan Ach, of course. Grand oversight of my part, of course there is
IChangeSet#getComponent

Ok, makes sense. I will always need the Component for context because that is where the change set "lives".

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937

Question asked: Aug 15 '14, 8:45 a.m.

Question was seen: 4,611 times

Last updated: Aug 15 '14, 9:21 a.m.

Confirmation Cancel Confirm